package models;

import play.Play;

/**
 * Represents the Client data for authorized Access to Google's APIs
 * 
 * For more information see: https://code.google.com/apis/console/
 * @author Vanilson Buregio
 *
 */
public class ClientApiAccess {
	
	private String authURL;  // used to get access code
	private String tokenURL; // used to exchange code for token
	private String scope;

	// Client API
	private String clientId;
	private String emailAddress;
	private String secret;
	private String redirect;
	
	public String getClientId() {
		return clientId;
	}
	
	public void setClientId(String clientId) {
		this.clientId = clientId;
	}
	public String getEmailAddress() {
		return emailAddress;
	}
	public void setEmailAddress(String emailAddress) {
		this.emailAddress = emailAddress;
	}
	public String getSecret() {
		return secret;
	}
	public void setSecret(String secret) {
		this.secret = secret;
	}
	public String getRedirect() {
		return redirect;
	}
	public void setRedirect(String redirectURI) {
		this.redirect = redirectURI;
	}
	
	public String getScope() {
		return scope;
	}

	public void setScope(String scope) {
		this.scope = scope;
	}

	public String getAuthURL() {
		return authURL;
	}

	public void setAuthURL(String authURL) {
		this.authURL = authURL;
	}

	public String getTokenURL() {
		return tokenURL;
	}

	public void setTokenURL(String tokenURL) {
		this.tokenURL = tokenURL;
	}

	/**
	 * Load CalendarYou API Access data
	 */
	public ClientApiAccess loadCalendarYouGoogleApiAccess() {
		authURL = Play.application().configuration().getString("google.api.endpoint.auth");
		tokenURL = Play.application().configuration().getString("google.api.endpoint.token");
		clientId = Play.application().configuration().getString("google.calendaryou.client.id");
		redirect = Play.application().configuration().getString("google.calendaryou.client.redirect");
		secret = Play.application().configuration().getString("google.calendaryou.client.secret");
		scope = Play.application().configuration().getString("google.calendar.scope");
		return this;
	}
		
	
}
